VBossAPI.DLL v1.0 rev 1.52 Copyright © 1995, Greg Truesdell CIS : 74131,2175 Internet: 74131.2175@compuserve.com ========================================================================= ARCHIVE CONTENTS ================ This archive should include the following files: VBOSSAPI.DLL The OSS Library VBOSSAPI.HLP The OSS Library (Windows) Help file VBOSSAPI.BAS The OSS Library Visual Basic Declarations File REGISTER.TXT Registration Form README.TXT The file you are reading SAMPLE.FRM \ SAMPLE.BAS +--> Sample demonstration project SAMPLE.PRJ | SAMPLE.MAK | TERP.FRM | OUTLINE.BAS / INTRODUCTION ============ VBossAPI.DLL is a library of functions that help the Visual Basic Programmer develop script-parsing applications. Although it is not a complete set of tools for compiler design, it is a good set of script processing tools. The functions provided offer both Word-Related and Keyword/Token related operations required to implement text parsing and script processing applications. There are functions for parsing text strings, defining keyword tokens (for language-independant scripts) and defining simple variables. Also included are functions for storing and loading keyword/token tables. This allows you to support several languages without changing the basic code of your application. Operators (ie: =, (), *, / etc) are supported internally to simplify the development process. THEORY OF OPERATION =================== TOKENS, KEYWORDS and OPERATORS ------------------------------ VBossAPI.DLL allows you to relate a text string (ie: BEGIN) with a token value (ie: 100). Operators (ie: !@#$%^&*()-=+{}[] etc) use predefined tokens. Word delimiters are defined internally (all characters from &H01 to &H20) for token related functions. All you need to do is define the keywords you want to use. Once you have defined the keywords and their tokens, you then must write an interpreter to operate on sequences of tokens (Syntax). VBossAPI.DLL provides the core functions required for scanning text and determining the type of word or keyword found. For example: If you were to define the following: Keyword Token --------------- ------ DIM 100 INTEGER 101 AS 102 and you passed a text string with the following text in it: Dim Counter As Integer Counter=10*3 the VBossAPI.DLL NextToken() function, on subsequent calls, would return: Token Keyword ----- ---------- 100 DIM -3 COUNTER (-3 or NT_TOKEN_NOTFOUND) 102 AS 101 INTEGER ... at this point your code would know enough to define the variable. ... (See AddVariable()) -5 COUNTER (-5 or NT_VARIABLE_FOUND) 22 = (Pre-defined operator token) -3 10 (-3 or NT_TOKEN_NOTFOUND In this case, a CONSTANT) 3 * (Pre-defined operator token) -3 3 (-3 or NT_TOKEN_NOTFOUND In this case, a CONSTANT) -1 (-1 or NT_PAST_EOL or End of the Program) The token values tell your program what action to take. The keyword contents provide enough information to determine how they should be used. If the token value is negative, the current keyword is not a reserved keyword; it is most likely a constant (ie: number) or a variable name. All of the dirty work concerned with parsing the language components is handled for you by the token related functions. And whenever a defined variable is encountered in the script, the NextToken() function let's you know that is a variable. All you need to do is get its value and data type with the GetVariable() call. WORD and TEXT PARSING OPERATIONS -------------------------------- VBossAPI includes a complete set of word (text fragments) parsing functions. You can use these with or without the token parsing functions. Beyond the obvious word and line counting possibilities you can implement content and context sensitive text formatting. In concert with token related functions, you can build source code formatters, parsers and reporters. Once you are no longer burdened with the details of parsing and separating text fragments you are freed to concentrate on what functionality you want in your program. BEST OF ALL, IT'S INEXPENSIVE! ============================== For the cost of less than an hours work, you can have the whole set. The functions are clean and fast. And, once registered, you are free to distribute the DLL with your applications without royalties (just so long as you do not distribute it as part of a product that performs the same basic functions.) Also, any problems or suggestions concerning the library will be responded to quickly and courtiously. FOR MORE INFORMATION ==================== See the REGISTER.TXT and VBOSSAPI.HLP files.